/*
 * Copyright (C) 2010 CODEBISTRO LLC, Sunnyvale, California.
 * All rights reserved. Proprietary and Confidential.
 */

package org.codebistro.util;

public class Strings extends Strings14 {
    
    public static String join(Iterable<?> coll, String separator) {
// Not sure why this is necessary 
//        if (coll == null) {
//            return null;
//        }
        boolean first= true;
        StringBuffer b= new StringBuffer();
        join(b, coll, separator);
        return b.toString();
    }

    public static void join(StringBuffer b, Iterable<?> coll, String separator) {
        if (separator == null) {
            separator = EMPTY;
        }
        boolean first= true;
        for(Object obj : coll) {
            if (obj!=null) {
                if (first)
                    first= false;
                else
                    b.append(separator);
                b.append(obj.toString());
            }
        }
    }


}
